import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 歌单Id唯一标识
    playId:null,
    // 歌单列表
    playList:[],
    user:null,
  },
  mutations: {
    // 保存当前歌单列表
    changePlayList(state,playListInfo){
        state.playId = playListInfo.id
        state.playList = playListInfo.list 
    },
    // 保存当前登录用户
    addUser(state,user){
      state.user = user
    }
  },
  actions: {
  },
  modules: {
  }
})
